import request from '@/utils/request'
export const getSpuList = ({ page, limit, category3Id }) => request({
    url: `/list-api/admin/product/${page}/${limit}`,
    method: 'get',
    params: { category3Id }
})
//获取spu信息
export const getSpuById = (id) => request({
    url: `/list-api/admin/product/getSpuById/${id}`,
    method: 'get'
})
//获取spu图片
export const getSpuImageList = (id) => request({
    url: `/list-api/admin/product/spuImageList/${id}`,
    method: 'get'
})
//获取品牌信息
export const getTrademarkList = () => request({
    url: `/list-api/admin/product/baseTrademark/getTrademarkList`,
    method: 'get'
})
//获取spu销售属性
export const getBaseSaleAttrList = () => request({
    url: `/list-api/admin/product/baseSaleAttrList`,
    method: 'get'
})
// 编辑的spu属性 /admin/product/saveSkuInfo post
export const updateSpuInfo = (skuInfo) => request({
    url: `/list-api/admin/product/updateSpuInfo`,
    method: 'post',
    data: skuInfo
})
// 新增spu  无id为新增
export const saveSpuInfo = (skuInfo) => request({
    url: `/list-api/admin/product/saveSpuInfo`,
    method: 'post',
    data: skuInfo
})
// 删除spu DELETE /admin/product/deleteSpu/{spuId}
export const deleteSpu = (spuId) => request({
    url: `/list-api/admin/product/deleteSpu/${spuId}`,
    method: 'DELETE'
})
// /list-api/admin/product/spuImageList/2059
// /list-api/admin/product/spuSaleAttrList/2059
// 获取spuSaleAttrList
export const getSpuSaleAttrList = (spuId) => request({
    url: `/list-api/admin/product/spuSaleAttrList/${spuId}`,
    method: 'get'
})
// /list-api/admin/product/attrInfoList/1/1/2
export const getAttrInfoList = ({ category1Id, category2Id, category3Id }) => request({
    url: `/list-api/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
    method: 'get'
})
// /list-api/admin/product/saveSkuInfo
export const saveSkuInfo = (skuInfo) => request({
    url: `/list-api/admin/product/saveSkuInfo`,
    method: 'post',
    data: skuInfo
})
